//
//  PS_WeiQuanViewController.m
//  FinanceSupermarket
//
//  Created by 丹丹 on 2018/12/17.
//  Copyright © 2018年 xuezi. All rights reserved.
//

#import "PS_WeiQuanViewController.h"
#import "PS_HotTitleTableViewCell.h"
#import "PS_HotImagesTableViewCell.h"
#import "PS_HotVideoTableViewCell.h"
#import "PS_HotContentTableViewCell.h"
@interface PS_WeiQuanViewController ()<UITableViewDelegate,UITableViewDataSource>
@property (nonatomic, strong)UITableView * listTableView;

@end

@implementation PS_WeiQuanViewController
- (UITableView *)listTableView{
    
    if (_listTableView == nil) {
        
        _listTableView = [[UITableView alloc]initWithFrame:CGRectMake(0,0, SCREEN_WIDTH,SCREEN_HEIGHT - 175-52-SafeAreaTopHeight-SafeAreaBottomHeight-49)];
        _listTableView.dataSource = self;
        _listTableView.delegate = self;
        _listTableView.showsVerticalScrollIndicator= NO;
        _listTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
        _listTableView.scrollEnabled = YES;
    }
    
    return _listTableView;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    self.nav_btmView.hidden = YES;
     [self.view addSubview:self.listTableView];
    // Do any additional setup after loading the view.
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    
    return 10;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    
    //        PS_ReMenHuiDaModel * model = [self.reMenHuiDaArray objectAtIndex:indexPath.row];
    //
    //        if (model.view_type == 1) {
    //
    //            return 90;
    //
    //        }else if (model.view_type == 2){
    //
    //            return 130;
    //
    //        }else if(model.view_type == 3){
    //
    //            return 155;
    //
    //        }else{
    //
    //            return 275;
    //        }
    
    if (indexPath.row == 0) {
        
        return 90;
        
    }else if (indexPath.row == 1){
        
        return 130;
        
    }else if(indexPath.row == 2){
        
        return 155;
        
    }else{
        
        return 275;
    }
    
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
    
    return 30;
}

-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
    
    return 55;
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    
    //        PS_ReMenHuiDaModel * model = [self.reMenHuiDaArray objectAtIndex:indexPath.row];
    
    if (indexPath.row  == 0) {
        
        
        PS_HotTitleTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"PS_HotTitleTableViewCell"];
        if (cell == nil) {
            
            cell = [[[NSBundle mainBundle]loadNibNamed:@"PS_HotTitleTableViewCell" owner:self options:nil]objectAtIndex:0];
            
        }
        
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        //            [cell setDataForCell:model];
        return cell;
        
        
    }else if(indexPath.row  == 1){
        
        PS_HotContentTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"PS_HotContentTableViewCell"];
        if (cell == nil) {
            
            cell = [[[NSBundle mainBundle]loadNibNamed:@"PS_HotContentTableViewCell" owner:self options:nil]objectAtIndex:0];
            
        }
        
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        //            [cell setDataForCell:model];
        return cell;
        
        
        
    }else if(indexPath.row  == 2){
        
        PS_HotImagesTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"PS_HotImagesTableViewCell"];
        if (cell == nil) {
            
            cell = [[[NSBundle mainBundle]loadNibNamed:@"PS_HotImagesTableViewCell" owner:self options:nil]objectAtIndex:0];
            
        }
        
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        //            [cell setDataForCell:model];
        return cell;
        
        
    }else{
        
        PS_HotVideoTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"PS_HotVideoTableViewCell"];
        if (cell == nil) {
            
            cell = [[[NSBundle mainBundle]loadNibNamed:@"PS_HotVideoTableViewCell" owner:self options:nil]objectAtIndex:0];
            
        }
        
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        //            [cell setDataForCell:model];
        return cell;
    }
    
    
    
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
